﻿@{
    ViewBag.Title = "Common Command";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
        <ol class="breadcrumb">
            <li><a href="/Home.html">Home</a></li>
            <li><a href="/WebApp/WebApi"> Sanelib WebApp</a></li>
    <li class="active">Email</li>
</ol>
      
            
            <div id="introduction">
                <h1 class="text-left">E-Mail</h1>
            </div>
            <div id="Mail" >
                <div id="SettingMessage">
                    <p>E-Mail Through PowerShell Script<br />First lets first setup the "System.Net.Mail.MailMesage" through an object</p>

                    Lets Observe the Property of an MailMessage object.<br />
                    <table class="table table-condensed">
                        <tr>
                            <td><strong>Property</strong></td>
                            <td><strong>Description</strong></td>
                        </tr>
                        <tr>
                            <td class="active">From</td>
                            <td>Sender Mail Address</td>
                        </tr>
                        <tr>
                            <td class="active">To</td>
                            <td>Gets the address collection that contains the recipients of this e-mail message.</td>
                        </tr>
                        <tr>
                            <td class="active">Subject</td>
                            <td>Gets or sets the subject line for this e-mail message.</td>
                        </tr>
                        <tr>
                            <td class="active">Attachment</td>
                            <td>Gets the attachment collection used to store data attached to this e-mail message.</td>
                        </tr>
                        <tr>
                            <td class="active">Header</td>
                            <td>Gets the e-mail headers that are transmitted with this e-mail message. </td>
                        </tr>
                        <tr>
                            <td class="active">Priority</td>
                            <td>Gets or sets the priority of this e-mail message.</td>
                        </tr>
                        <tr>
                            <td class="active">DiliveryNotificationOptions</td>
                            <td>Gets or sets the delivery notifications for this e-mail message.</td>
                        </tr>
                        <tr>
                            <td class="active">BodyEncoding</td>
                            <td>Gets or sets the encoding used to encode the message body.</td>
                        </tr>
                        <tr>
                            <td class="active">BCC</td>
                            <td>Gets the address collection that contains the blind carbon copy (BCC) recipients for this e-mail message.</td>
                        </tr>
                        <tr>
                            <td class="active">AlternateViews</td>
                            <td>Gets the attachment collection used to store alternate forms of the message body.</td>
                        </tr>
                    </table>
                    <p class="alert-info">Attachments uses “System.Net.Mail.Attachments” Class to be specified in the Script.</p><br />

                    <img src="~/Images/Wps/Mail_WPS_01.png" class="img-thumbnail center-block" />
                </div>
                <div id="Setting_SMTP">
                    <p><strong>SMTPClient Setup</strong></p>
                    <p>Allows applications to send e-mail by using the Simple Mail Transfer Protocol (SMTP).</p>
                    <p class="alert-info">To define a SMTPClient Object We Use “System.Net.Mail.SMTPClient” Class.</p><br />
                    <strong>Constructor</strong>
                    <table class="table table-striped">
                        <tr>
                            <td><strong>Name</strong></td>
                            <td><strong>Description</strong></td>
                        </tr>
                        <tr>
                            <td>SmtpClient()</td>
                            <td>Initializes a new instance of the SmtpClient class by using configuration file settings. </td>
                        </tr>
                        <tr>
                            <td>SmtpClient(string)</td>
                            <td>Initializes a new instance of the SmtpClient class that sends e-mail by using the specified SMTP server. </td>
                        </tr>
                        <tr>
                            <td>SmtpClient(String, Int32)</td>
                            <td>Initializes a new instance of the SmtpClient class that sends e-mail by using the specified SMTP server and port. </td>
                        </tr>
                    </table>
                    <table class="table table-condensed">
                        <tr>
                            <td><strong>Property</strong></td>
                            <td><strong>Description</strong></td>
                        </tr>
                        <tr>
                            <td class="active">Host</td>
                            <td>Gets or sets the name or IP address of the host used for SMTP transactions.</td>
                        </tr>
                        <tr>
                            <td class="active">Port</td>
                            <td>Gets or sets the port used for SMTP transactions.</td>
                        </tr>
                        <tr>
                            <td class="active">EnableSsl</td>
                            <td>Specify whether the SmtpClient uses Secure Sockets Layer (SSL) to encrypt the connection.</td>
                        </tr>
                        <tr>
                            <td class="active">UseDefaultCredentials</td>
                            <td>Gets or sets a Boolean value that controls whether the DefaultCredentials are sent with requests.</td>
                        </tr>
                        <tr>
                            <td class="active">ClientCertificates</td>
                            <td>Specify which certificates should be used to establish the Secure Sockets Layer (SSL) connection.</td>
                        </tr>
                        <tr>
                            <td class="active">Credentials</td>
                            <td>Gets or sets the credentials used to authenticate the sender.</td>
                        </tr>
                    </table>
                    <p>Using SmtpClient Object we can set these above properties.</p>
                    <pre>Example: Setting Up Gmail for SMTP.<img src="~/Images/Wps/Mail_WPS_02.png" class="center-block" /></pre>
                </div>
            </div>

      